﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DemoControl : MonoBehaviour {
    public Vector2 inputValue = Vector2.zero;
    public static DemoControl Instance;
    void Awake()
    {
        Instance = this;
    }

	void Update () {
        var v = Input.GetAxisRaw("Vertical");
        var h = Input.GetAxisRaw("Horizontal");
        var vec2 = new Vector2(v, h);
        if (vec2.magnitude > 1)
        {
            vec2.Normalize();
            v = vec2.x;
            h = vec2.y;
        }
        inputValue = new Vector2(h, v);
	}
}
